/**
 * Created by linyu on 2016/11/17.
 * 老师选择树，用于选取班主任，任课老师，通知权限等
 */
(function () {

    var teacher_tree = function (config) {
        this.ename = encodeURI(config.title||'选择树');
        this.check_type = config.check_type || 'radio';
        this.callback = config.callback || '';
        this.ext = config.ext || 0;
        this.intercept = config.intercept || "ChooseTeacherIntercept";
        this.type = config.type || "opentreeTeacherDept";
        this.id = config.id || 0;
        this.callback = config.callback || '';
        this.value = config.value || 0;
        this.where = config.where ? encodeURI(config.where) : 0;

    };

    teacher_tree.prototype = {

        choose : function(){
            var urlParaSeparator = "-";
            layer.open({
                type: 2,
                title:"树形选择",
                area: ["250", "420px"],
                fix: false, //不固定
                maxmin: true,
                content: ctx + "/ztree/open/"
                +this.type+urlParaSeparator
                +"_0"+urlParaSeparator
                +this.ename+urlParaSeparator
                +"0"+urlParaSeparator
                +this.check_type+urlParaSeparator
                +this.where+urlParaSeparator
                +this.intercept+urlParaSeparator
                +this.ext+urlParaSeparator
                + this.value+urlParaSeparator
                + this.id +urlParaSeparator
                + this.callback
            });
        }
    }

    window.teacher_tree = teacher_tree;

} ());
